#Lindsay Ergenekan
#ergenekl@onid.oregonstate.edu
#CS311-400
#Assignment1 Question8

import math

prime_powers = 2
prime_square = [prime_powers]
prime_powers+=1
prime_square.append(prime_powers)
#count includes both 2 and 3
count = 2


limit= raw_input("\n Upto what number would you like to generate primes? ")
while prime_powers < int(limit):
    prime_powers+=2
    test=True
    square_root_prime_powers = math.sqrt(prime_powers)
    for a in prime_square:
        if a >square_root_prime_powers:break
        if prime_powers%a == 0:
            test = False
            break
        if test:
            if prime_powers not in prime_square:
                
                prime_square.append(prime_powers)
                count += 1

print prime_square
print ("\nThis is the how many primes there are :" )
print count

